<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- 第一步:引包 -->
    <script src="./echarts.js"></script>
    <style>
        .box {
            width: 800px;
            height: 400px;
            margin: 30px auto;
            border: 1px solid black;
        }
    </style>
</head>

<body>
    <!-- 容器:wh -->
    <div class="box"></div>
</body>

</html>
<script>
    //第一步:初始化echarts实例
    let mycharts = echarts.init(document.querySelector('.box'));
    //第二步:配置项
    let option = {
       title:{
           text:'数据集'
       },
       xAxis:{
           //x轴均匀分布
           type:'category'
       },
       yAxis:{

       },
       //把全部的图形图标数据集合在一起---二维数组
       dataset:{
           source:[
                ['军事',20,12,'裤子',10],
                ['游戏',30,77,'鞋子',10],
                ['人生',40,69,'衣服',10],
                ['资产',50,88],
                ['财经',60,21]
           ]
       },
       //系列
       series:[
           {type:'bar',encode:{x:0,y:1}},
           {type:'line',encode:{x:0,y:2}},
           {type:'pie',encode:{itemName:0,value:1},width:250,height:250,radius:50}
       ]
    };
    //第三步：设置配置项
    mycharts.setOption(option);

</script>